/**
 * 
 * @author Chris Fraser, Jean-Luc Richard
 *
 */

public class Player 
{

	private String name;
	private String record;
	
	public static final int WIN_VALUE = 1;
	public static final int LOSS_VALUE = 0;
	
	public Player(String textIn)
	{
		this.name = textIn.split(",")[0];
		this.record = textIn.split(",")[1].split(" ")[0];
	}
	
	public String getName()
	{
		return this.name;
	}
	
	public String getRecord()
	{
		return this.record;
	}
	
	public void updateRecord(int winOrLoss)
	{
		int wins = Integer.valueOf(this.getRecord().split("/")[0]);
		int losses = Integer.valueOf(this.getRecord().split("/")[1]);
		if(winOrLoss == WIN_VALUE)
		{
			wins++;
		}
		else
		{
			losses++;
		}
		
		this.record = String.valueOf(wins) + "/" + String.valueOf(losses); 		
	}
}
